﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="NewSubject.aspx.cs" Inherits="Manage_Cms_NewSubject" %>

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <!--#include file="../js/html_head.inc"-->
    <link rel="stylesheet" type="text/css" href="../Themes/<%=ManageHelper.GetTheme()%>/style.css" />

    <script type="text/javascript" language="javascript" src="../JS/jquery.js"></script>

    <script type="text/javascript" language="javascript">
        function save()
        { 
            var IndexName=document.getElementById("IndexName").value;
            var ColumnName=document.getElementById("ColumnName").value;
            if(IndexName=="")
            {
                alert("专题名称不能为空！");
                return false;
            }
            else if(ColumnName=="")
            {
                alert("专题栏目名称不能为空！");
                return false;
            }
            var title=document.getElementsByName("xwtitle");
            for(var i=0;i<title.length;i++)
            { 
                if(title[i].value=="")
                {
                    alert("请检查是否所有新闻标题都写好！");
                    return false;
                }
            }
	    }
    </script>

</head>
<body>
    <%=ManageHelper.PageSucMsg()!=""?"<div class='msg_succeed'>"+ManageHelper.PageSucMsg()+"</div>":""%>
    <%=ManageHelper.PageErrMsg()!=""?"<div class='msg_failed'>"+ManageHelper.PageErrMsg()+"</div>":""%>
    <form method="post" action="?act=<%=act %>&ID=<%=ID %>&FileID=<%=FileID %>&siteid=<%=siteid %>" id="NewSubjectForm" name="NewSubjectForm" enctype="multipart/form-data">
        <div class="mycolumn">
            <div class="columntitle">
                编辑专题信息&nbsp;
            </div>
            <div style="width: 100%; height: 200px; border-bottom: 1px #93b9dc solid;">
            <div style="float:left; margin-left:100px;overflow: auto; height:200px; width:300px;">
                    <table>
                        <%
                            int tp = 0;
                            int xw = 0;
                            int xwt = 0;
                            foreach (string tempalte in templates)
                            {
                                if (tempalte.IndexOf("TP") == 0)
                                {
                                    tp++;
                                    %>
                                        <tr style="height:40px;">
                                            <td>
                                                <img src="../pic/icons/help.gif"  alt=""/>
                                                <span style="font-size: 12px;">图片<%=tp %>：</span>
                                            </td>
                                            <td>
                                              <input name="TP" type="file" /> 
                                            </td>
                                        </tr>
                                    <%
                                }
                                else if (tempalte.IndexOf("XW") == 0)
                                {
                                    xw++;
                                    int intTemp = modelCmsNode.ParentID;
                                    if (act == "editSave")
                                    {
                                        intTemp = Convert.ToInt32(Nodes[xw]);
                                    }
                                    %>
                                    <tr style="height:40px;">
                                        <td align="left">
                                            <img src="../pic/icons/help.gif" alt=""/>
                                            <span style="font-size: 12px;">新闻<%=xw %>：</span>
                                        </td>
                                        <td>
                                        <select id="select1" name="selectList" style="width: 160px">
                                        
                                        <%=SelectNodeList(0, intTemp, modelCmsNode.NodeID)%>
                                        </select>
                                        </td>
                                    </tr>
                                    <%
                                }
                                else if (tempalte.IndexOf("xTitle") == 0)
                                {
                                    xwt++;
                                    %>
                                    <tr>
                                        <td align="left">
                                            <img src="../pic/icons/help.gif"  alt=""/>
                                            <span style="font-size: 12px;">新闻标题<%=(xw+1)%>：</span>
                                        </td>
                                        <td>
                                        <%if (act == "editSave")
                                              { %>
                                            <input name="xwtitle" type="text" value="<%=HttpUtility.HtmlEncode(Titles[xwt])%>"/> 
                                            <%}
                                              else
                                              { %>
                                              <input name="xwtitle" type="text" /> 
                                              <%} %>
                                        </td>
                                    </tr>
                                    <%
                                }
                            }
                        %>
                    </table>
                </div>
            <div style="float:left; width:400px;">
                <div>
                <table>
                    <tr>
                        <td align="left">
                            <img src="../pic/icons/help.gif" alt="aa" />
                            <span style="font-size: 12px;">专题名称：</span></td>
                        <td align="left" >
                            <input <%=act=="editSave"?"disabled":"" %> type="text" id="ColumnName" name="ColumnName" style="border: 1px #93b9dc solid;" value="<%=nodename%>" /><input type="hidden" value="<%=nodename%>" name="ColumnNamehidden" />
                        </td>
                    </tr>
                    <tr style="height:12px;">
                    <td></td>
                    <td><span style="font-size: 12px; color: Red;">请勿与其他专题同名</span></td>
                    </tr>
                    <tr>
                        <td>
                            <img src="../pic/icons/help.gif" alt="aa" />
                            <span style="font-size: 12px;">专题英文名称：</span>
                        </td>
                        <td>
                            <input <%=act=="editSave"?"disabled":"" %> id="IndexName" name="IndexName" type="text" style="border: 1px #93b9dc solid;" value="<%=nodeindex%>" /><input type="hidden" value="<%=nodeindex%>" name="IndexNamehidden" />
                        </td>
                    </tr>
                    <tr style="height:12px;">
                    <td></td>
                    <td><span style="font-size: 12px; color: Red;">请使用英文，且不能与其他专题同名</span></td>
                    </tr>
                    <tr >
                            <td align="left"  width="126" height="26">
                                <img src="../pic/icons/help.gif" alt="内容页模板文件" onclick="helpInf(this)" /> 内容页模板文件：
                            </td>
                            <td align="left" class="tdselect">
                                <select name="ContentDefaultTemplateFile" >
                                    <%=KeRui.BLL.Common.GetSelectListForTemplate(modelCmsNode.ContentDefaultTemplateFile == null ? "" : modelCmsNode.ContentDefaultTemplateFile, dsContentTemp)%>
                                </select>
                            </td>
                        </tr>
                    <tr >
                            <td align="left"  width="126" height="26">
                                <img src="../pic/icons/help.gif" alt="评论页模板文件" /> 评论页模板文件：
                            </td>
                            <td align="left" class="tdselect">
                                <select name="CommentTemplate" >
                                    <%=KeRui.BLL.Common.GetSelectListForTemplate(modelCmsNode.CommentTemplate == null ? "" : modelCmsNode.CommentTemplate, dsCommentTemp)%>
                                </select>
                            </td>
                        </tr>
                </table>
                </div>
                <div style="height:50px; margin-top:30px;">
                <input onclick="return save();" class="button" style="width: 50px;" name="bc" type="submit" value="保存" />&nbsp; &nbsp; &nbsp; &nbsp;
                <input onclick="location.href='subject.aspx?siteid=<%=siteid %>'" class="button" style="width: 50px;" type="button" value="返回" />
                </div>
                </div>
            </div>
            <div class="columntitle">模板图片&nbsp;</div>
            <div>
                <div style="width: 100%; height:500px; border-right: 1px #93b9dc solid;
                    overflow: auto;">
                    <div style="float:left;">
                    <img style="width:100%;" src="<%=modelCmsTemplateFileAttr.PicPath %>"  alt=""/>
                    </div>
                </div>
            </div>
        </div>
    </form>
</body>
</html>
